package com.snow.dayou.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * All rights Reserved, Designed By www.cusc.com
 *
 * @author yanke
 * @Title: UserController
 * @Package com.snow.dayou.controller
 * @Description:类描述
 * @Email yanke@cu-sc.com
 * @version: v1.0.0
 * @date: 2021/3/31/0031 16:39
 * @Copyright: 2021  www.faw.com.cn Inc. All rights reserved. <br/>
 * Modification History:<br/>
 * Date         Author          Version            Description<br/>
 * *---------------------------------------------------------*<br/>
 * 2021/3/31/0031     Administrator           v1.0.0               修改原因<br/>
 * @since JDK 1.8
 */
@Slf4j
@RestController
@RequestMapping("/mall")
@RefreshScope
public class MallController {

    @Value("${swagger.enable}")
    private Boolean b;

    @Autowired
    private RestTemplate restTemplate;
//    @Autowired
//    private MinioUtils minioUtils;

    @GetMapping("/{id}")
    public String login(@PathVariable Long id) {
        log.info("Mall登录:{}", id);
        return String.valueOf(id);
    }

    @GetMapping("/nacos")
    public Boolean queryNacosValue() {
        return b;
    }

//    @GetMapping("/minio")
//    public String minio() {
//        String endpoint = minioUtils.getMinioConfig().getEndpoint();
//        minioUtils.uploadFile();
//        return endpoint;
//    }
}
